<?php
error_reporting(E_ALL); 
ini_set("display_errors", 1);
$configFile= "./config.php";
if (file_exists($configFile)) { 
  require_once("./config.php");
} else {
  die("File di $configFile configurazione mancante. ");
}
require_once("./lib/fb_utils.php");
require_once("./lib/Module.class.php");
require_once("./lib/Request.class.php");
require_once("./lib/Renderer.class.php");
require_once("./phpsdk/facebook.php");
require_once("./lib/MyFacebook.class.php");

$facebook = MyFacebook::getInstance();

//$session = $facebook->getSession();
//$cookie = get_facebook_cookie(FACEBOOK_APP_ID, FACEBOOK_SECRET);
require_once("./tpl/tpl_header.php");
Module::loadModule("login");
if ($facebook) {
  $action = Request::getParameter("action", "main");
  $viewsource = Request::getParameter("viewsource", "0", "01");
  Module::loadModule($action, "main");
  if ($viewsource == "1") {
    Module::viewSource($action);
  }
} else {
  $errorMessage="Istanza FACEBOOK non inizializzata";
  Module::loadModule("error");
}
require_once("./tpl/tpl_footer.php");

